package com.bkgy.controller.qualityDaily.controller;

import com.bkgy.controller.qualityDaily.entity.pdo.InfoReq;
import com.bkgy.controller.qualityDaily.service.IQualitydailyInfoService;
import com.bkgy.controller.qualityDaily.entity.QualitydailyInfo;
import com.bkgy.sys.common.entity.ResultData;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.bind.annotation.RequestMapping;

import javax.validation.Valid;

@Tag(name = "质量日报-情况说明")
@Controller
@RequestMapping("/quality")
public class QualitydailyInfoController {

    @Autowired
    private IQualitydailyInfoService service;

    @ResponseBody
    @Operation(summary = "新增", description = "质量日报》质量填报》情况说明》新增")
    @PostMapping("/qualitydailyadd")
    public ResultData<String> savequalityDaily(@RequestBody @Valid QualitydailyInfo obj) {
        return service.saveQualitydailyInfo(obj);
    }

    @ResponseBody
    @Operation(summary = "修改", description = "质量日报》质量填报》情况说明》修改")
    @PostMapping("/qualitydailyupdate")
    public ResultData<String> updatequalityDaily(@RequestBody @Valid QualitydailyInfo obj) {
        return service.updateQualitydailyInfo(obj);
    }

    @ResponseBody
    @Operation(summary = "删除", description = "质量日报》质量填报》情况说明》删除")
    @PostMapping("/qualitydailydel")
    public ResultData<String> deletequalityDaily(@RequestBody QualitydailyInfo obj) {
        return service.deleteQualitydailyInfo(obj);
    }

    @ResponseBody
    @Operation(summary = "分页查询", description = "质量日报》质量填报》情况说明》分页查询")
    @PostMapping("/getQualitydailyPage")
    public ResultData<String> selectPage(@RequestBody InfoReq obj) {
        return service.selectPage(obj);
    }
}
